﻿* {
    margin: 0px;
    padding: 0px;
}

body {
    width: 100%;
    height: 100%;
    background-image: url(images/bj.jpg);
}

body {
    height: 100%;
    background: linear-gradient(rgb(231, 230, 230) 0%, rgb(241, 224, 224) 50%);
}

.cube {
    position: relative;
    margin: 0px auto;
    margin-top: 20%;
    margin-left: 42%;
    width: 40px;
    height: 40px;
    transform: rotateX(-30deg) rotateY(-80deg);
    transform-style: preserve-3d;
    animation: rotate 15s infinite;
}

.cube .outer-cube,
.cube .inner-cube {
    transform-style: preserve-3d;
}


/* 旋转立方体 */

@keyframes rotate {
    from {
        transform: rotateX(0deg) rotateY(0deg);
    }
    to {
        transform: rotateX(360deg) rotateY(360deg);
    }
}


/* 外层立方体样式 */

.outer-cube .outer-top,
.outer-cube .outer-bottom,
.outer-cube .outer-right,
.outer-cube .outer-left,
.outer-cube .outer-front,
.outer-cube .outer-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1px solid #fff;
    opacity: 0.3;
    transition: all .9s;
}

.outer-cube img {
    width: 40px;
    height: 40px;
}

.outer-top {
    transform: rotateX(90deg) translateZ(20px);
}

.outer-bottom {
    transform: rotateX(-90deg) translateZ(20px);
}

.outer-front {
    transform: rotateY(0deg) translateZ(20px);
}

.outer-back {
    transform: translateZ(-20px) rotateY(0deg);
}

.outer-left {
    transform: rotateY(90deg) translateZ(20px);
}

.outer-right {
    transform: rotateY(-90deg) translateZ(20px);
}


/* 嵌套的内层立方体样式 */

.inner-cube>div {
    position: absolute;
    top: 7px;
    left: 7px;
    width: 26px;
    height: 26px;
}

.inner-cube img {
    width: 26px;
    height: 26px;
}

.inner-top {
    transform: rotateX(90deg) translateZ(13px);
}

.inner-bottom {
    transform: rotateX(-90deg) translateZ(13px);
}

.inner-front {
    transform: rotateY(0deg) translateZ(13px);
}

.inner-back {
    transform: translateZ(-13px) rotateY(180deg);
}

.inner-left {
    transform: rotateY(90deg) translateZ(13px);
}

.inner-right {
    transform: rotateY(-90deg) translateZ(13px);
}

.cube:hover .outer-top {
    right: -14px;
    bottom: -14px;
    opacity: 0.8;
    transform: rotateX(90deg) translateZ(40px);
}

.cube:hover .outer-bottom {
    right: -14px;
    bottom: -14px;
    opacity: 0.8;
    transform: rotateX(-90deg) translateZ(40px);
}

.cube:hover .outer-front {
    right: -14px;
    bottom: -14px;
    opacity: 0.8;
    transform: rotateY(0deg) translateZ(40px);
}

.cube:hover .outer-back {
    right: -14px;
    bottom: -14px;
    opacity: 0.8;
    transform: translateZ(-40px) rotateY(0deg);
}

.cube:hover .outer-left {
    right: -14px;
    bottom: -14px;
    opacity: 0.8;
    transform: rotateY(90deg) translateZ(40px);
}

.cube:hover .outer-right {
    right: -14px;
    bottom: -14px;
    opacity: 0.8;
    transform: rotateY(-90deg) translateZ(40px);
}

.message .author {
    position: absolute;
    right: 10px;
    background-image: -webkit-linear-gradient(left, blue, #66ffff 10%, #cc00ff 20%, #CC00CC 30%, #CCCCFF 40%, #00FFFF 50%, #CCCCFF 60%, #CC00CC 70%, #CC00FF 80%, #66FFFF 90%, blue 100%);
    font-size: 7px;
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    -webkit-background-size: 200% 100%;
    -webkit-animation: masked-animation 4s linear infinite;
}

@keyframes masked-animation {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: -100% 0;
    }
}